import { defHttp } from '/@/utils/http';

export function getRolesApi(params: any) {
  return defHttp.get<any>({ url: '/api/roles', params }, { joinParamsToUrl: true });
}

export function addRoleApi(params: any) {
  return defHttp.post<any>({ url: '/api/roles', params });
}

export function editRoleApi(params: any) {
  return defHttp.put<any>({ url: '/api/roles', params });
}

export function delRoleApi(ids: any) {
  return defHttp.delete<any>({ url: '/api/roles', params: ids });
}

// 获取所有的Role
export function getAllRolesApi() {
  return defHttp.get<any>({ url: '/api/roles/all' }, { joinParamsToUrl: true });
}

export function editRoleMenuApi(params: any) {
  return defHttp.put<any>({ url: '/api/roles/menu', params });
}

export function getLevelApi() {
  return defHttp.get<any>({ url: '/api/roles/level' }, { joinParamsToUrl: true });
}
